import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";

/*
 * @Descripttion: GGB
 * @version: 1.0
 * @Author: GGB
 * @Date: 2021-12-09 06:13:28
 * @LastEditors: GGB
 * @LastEditTime: 2021-12-09 06:53:08
 */
export type AppRouteRecordRaw = RouteRecordRaw & {
    hidden?: boolean
}
const router = createRouter({
    history: createWebHashHistory(),
    routes: [
        {
            path: '/',
            component: () => import('../views/Home.vue'),
            meta: {
                title: "待办列表",
                icon: 'el-icon-document'
            }
        },
        {
            path: '/add',
            hidden: true,
            component: () => import('../views/AddTodo.vue')
        },
    ] as AppRouteRecordRaw[]
})

router.beforeEach((to, from, next) => {
    next()
})

export default router